/**
 * @file e6_t2_q2.c
 * @date 2022-03-09
 * 
 * 
 * @copyright Copyright (c) 2022 cnzyx MIT Licence
 * 
 */

#include<stdio.h>
#include<stdlib.h>

void convert(int num,char *str)
{
    static int i=0;
    if(num<0){
        str[i++]='-';
        return convert(-num,str);
        
    }
    int temp;
    if ((temp=num/10)!=0){
        convert(temp,str);
    }
    str[i++]=num%10+'0';
    str[i]='\0';
}

int main(int argc, char const *argv[])
{
    //UTF-8
    system("chcp 65001");

    int in_num;
    char str[101];
    printf("请输入一个整数：");
    scanf("%d",&in_num);
    convert(in_num,str);
    printf("结果：%s\n",str);
    
    //Pause console
    system("pause");
    return 0;
}
